import sys
import time
import json
from constdict import D


def fku(arg, *args, **kwargs):
    time.sleep(1)
    print( arg, type(arg))
    print( args, type(args))
    print( kwargs, type(kwargs))
    print('DICT ==> ', D['foo'])

if __name__ == "__main__":
    params = sys.argv[1:]
    args = ()
    kwargs = {}
    if len(params) > 0:
        _args = params[0]
        if _args.startswith("[") and _args.endswith("]"):
          args = tuple(json.loads(_args))
        else:
            args =(_args,)

    if len(params) > 1:
        _kwargs = params[1]
        if _kwargs.startswith("{") and _kwargs.endswith("}"):
            kwargs = dict(json.loads(_kwargs))

    time.sleep(1)
    print('args >> ', args)
    print('kwargs >> ', kwargs)
    fku(*args, **kwargs)
